package com.beiye.drivertransport.http;

import android.util.Log;

import com.android.frame.http.HttpListener;
import com.android.frame.http.HttpUtils;
import com.android.frame.http.RequestParams;
import com.beiye.drivertransport.config.AppInterfaceConfig;
import com.beiye.drivertransport.utils.MD5;

public class Course { //监督企业、监督人员

    /**
     * 2.3.1 企业培训状况（监管页面）
     * @param adId
     * @param channelId
     * @param ftId
     * @param orgName
     * @param planYm
     * @param firstIndex
     * @param pageSize
     * @param listener
     * @param what
     */
    public void queryForSpot(String adId, String channelId ,String ftId, String orgName ,String planYm,
                             int firstIndex ,int pageSize,HttpListener listener, int what){
        RequestParams params=new RequestParams();
        params.addParam("adId",adId);
        params.addParam("channelId", channelId);
        params.addParam("ftId",ftId);
        params.addParam("orgName", orgName);
        params.addParam("planYm",planYm);
        params.addParam("firstIndex", firstIndex+"");
        params.addParam("pageSize",pageSize+"");
        new HttpUtils().doCall1(AppInterfaceConfig.getRequestUrl("course/orgStatT/queryForSpot"),params,listener,what);
    }

    /**
     * 2.1.2 查询审核驾驶员安全学习列表
     * @param orgId
     * @param setYm
     * @param name
     * @param rtype
     * @param finishMark
     * @param mark
     * @param topMark
     * @param pjtMark
     * @param firstIndex
     * @param pageSize
     * @param listener
     * @param what
     */
    public void findByFilterForT(String orgId, String setYm ,String name, int rtype ,int finishMark,
                             int mark, int topMark,int pjtMark,int firstIndex ,int pageSize,
                             HttpListener listener, int what){
        RequestParams params=new RequestParams();
        params.addParam("orgId",orgId);
        params.addParam("setYm", setYm);
        params.addParam("name",name);
        params.addParam("rtype", rtype+"");
        params.addParam("finishMark",finishMark+"");
        params.addParam("mark", mark+"");
        params.addParam("topMark",topMark+"");
        params.addParam("pjtMark", pjtMark+"");
        params.addParam("firstIndex", firstIndex+"");
        params.addParam("pageSize",pageSize+"");
        new HttpUtils().doCall1(AppInterfaceConfig.getRequestUrl("course/useTcHour/findByFilterForT"),params,listener,what);
    }

    /**
     * 2.3.4  抽查
     * @param sn
     * @param spotCheckUserId
     * @param spotCheckMark
     * @param spotCheckDesc
     * @param listener
     * @param what
     */
    public void spotCheckUTCH(int sn, String spotCheckUserId ,int spotCheckMark, String spotCheckDesc,
                                 HttpListener listener, int what){
        RequestParams params=new RequestParams();
        params.addParam("sn",sn+"");
        params.addParam("spotCheckUserId", spotCheckUserId);
        params.addParam("spotCheckMark",spotCheckMark+"");
        params.addParam("spotCheckDesc", spotCheckDesc);
        new HttpUtils().doCall1(AppInterfaceConfig.getRequestUrl("course/useTcHour/spotCheckUTCH"),params,listener,what);
    }

    /**
     * 2.22 当前登录用户专题培训学习记录
     * @param userId
     * @param mark
     * @param listener
     * @param what
     */
    public void findByCond(String userId,int mark,HttpListener listener, int what){
        RequestParams params=new RequestParams();
        params.addParam("userId", userId);
        params.addParam("mark", mark+"");
        new HttpUtils().doCall1(AppInterfaceConfig.getRequestUrl("course/userStcHour/findByCond"),params,listener,what);
    }
}
